import request from '@/utils/request'

// 查询数据交换列表
export function listExchange(query) {
  return request({
    url: '/compre/exchange/list',
    method: 'get',
    params: query
  })
}

// 查询数据交换详细
export function getExchange(id) {
  return request({
    url: '/compre/exchange/' + id,
    method: 'get'
  })
}

// 新增数据交换
export function addExchange(data) {
  return request({
    url: '/compre/exchange',
    method: 'post',
    data: data
  })
}

// 修改数据交换
export function updateExchange(data) {
  return request({
    url: '/compre/exchange',
    method: 'put',
    data: data
  })
}

// 删除数据交换
export function delExchange(id) {
  return request({
    url: '/compre/exchange/' + id,
    method: 'delete'
  })
}

// 查询数据交换数据列表
export function getExchangeList(query = {}) {
  return request({
    url: '/compre/exchange/getAllList',
    method: 'get',
    params: query
  })
}

// 数据交换详情
export function getExchangeDetail(id) {
  return request({
    url: '/compre/exchange/' + id,
    method: 'get',
  })
}

// 数据申请
export function exchangeUse(data) {
  return request({
    url: '/compre/exchangeUse',
    method: 'post',
    data: data
  })
}
